{% extends 'draft/draft_base.html' %}
{% load static %}
{% block title %}发版草稿预览{% endblock title %}

{% block content %}
    <div class="container ml-auto mr-auto ">
        {# 发行版本号 #}
        <div class="field is-justify-content-space-between is-horizontal  pb-3">
            <div class="field is-horizontal">
                <div class="mr-3 is-normal">
                    <h4>产品名称: {{ row.product.name }}</h4>
                </div>
            </div>

            <div class="is-horizontal">
                <div class="ml-6 mr-3 is-normal">
                    <label class="is-size-6 has-text-centered">版本号:</label>
                </div>
                <div class="is-align-items-center">
                    {{ row.release_version }}
                </div>
            </div>

        </div>

        {#  发版内容 #}
        <div class="draft_body field ">

            {#  发行说明  #}
            <div class="release_note mt-4 field">
                <h4 class="is-size-6">发版说明</h4>
                <div class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth">
                    <table>
                        <thead>
                        <tr style="background-color: rgb(88,159,248); color: rgb(255, 255, 255);">
                            <th style="text-align: left; width: 231px;">发布版本</th>
                            <th style="text-align: left; width: 231px;">时间</th>
                            <th style="text-align: left; width: 231px;">备注</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr style="background-color: rgb(255, 255, 255);">
                            <td style="text-align:left;">{{ row.release_version }}</td>
                            <td style="text-align:left;">{{ row.create_time|date:"Y-m-d" }}</td>
                            <td style="text-align:left;">{{ row.release_remarks }}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>

            <br>

            {#  添加或更改功能  #}
            <div class="update_functions mt-5 field">
                <h4 class="is-size-6"> 添加或更改功能 </h4>
                <div class="field">
                    <label class="is-size-8"> - Front </label>
                    <div class="item_info">
                        {{ row.update_front }}
                    </div>

                    <label class="is-size-8"> - Back </label>
                    <div class="item_info">
                        {{ row.update_back }}
                    </div>

                </div>
            </div>

            {#  修复的bug  #}
            <br>

            <div class="fix_bug mt-5 field">
                <h4 class="is-size-6">修复的Bug</h4>
                <div class="field">
                    <label class="is-size-8"> - Front </label>
                    <div class="item_info">
                        {{ row.fixed_front }}
                    </div>

                    <label class="is-size-8"> - Back </label>
                    <div class="item_info">
                        {{ row.fixed_back }}
                    </div>
                </div>
            </div>

            <br>
            {#  存在的问题  #}
            <div class="fix_bug mt-5 field">
                <h4 class="is-size-6">存在的问题</h4>
                <div class="field">
                   {{ row.problems }}
                </div>
            </div>

            <br>
            {#  Commit hash  #}
            <div class="commit_hash mt-5 field">
                <h4 class="is-size-6">Commit hash</h4>
                <div class="field mt-4">
                    <div class=" field is-horizontal pb-1">
                        <div class="field ml-4 mr-3 is-normal">
                            <label class="is-size-6 has-text-centered">Front hash:</label>
                        </div>
                        <div class="field-body">
                            <figure class="highlight">
                                <code>{{ row.hash_front }}</code>
                            </figure>
                        </div>
                    </div>
                </div>

                <div class="field">
                    <div class=" field is-horizontal  pb-3">
                        <div class="field ml-4 mr-3 is-normal">
                            <label class="is-size-6 has-text-centered">Back hash:</label>
                        </div>
                        <div class="field-body">
                            <figure class="highlight">
                                <code>{{ row.hash_back }}</code>
                            </figure>
                        </div>
                    </div>
                </div>

            </div>

            <br/>

            {#  button  #}
            <div class="field mt-1 has-text-centered">
                <div class="column is-offset-8">
                    {% if row.status == 1 or row.status == 3 %}
                    <a class="btn btn-primary" href="{% url 'review_add' row.id %}"> 提交审核 </a>
                    {% elif row.status == 2%}
                    <a class="btn btn-success" href="{% url 'review_agree' row.id %}"> 同意发版 </a>
                    <a class="btn btn-danger" href="{% url 'review_disagree' row.id %}"> 拒接发版 </a>
                    {% else %}
                    {% endif %}
                    <a class="btn btn-default" href="{% url 'draft_list' %}"> 返回 </a>
                </div>
            </div>

        </div>

    </div>
{% endblock content %}